import LayoutMain from '@/layout';
import setting from '@/setting';

const pre = 'system_';

export default {
    path: '/system',
    name: 'system',
    header: 'system',
    redirect: {
        name: `${pre}configTab`,
    },
    meta: {
        auth: ['admin-system'],
    },
    component: LayoutMain,
    children: [
        {
            path: 'code_data_dictionary',
            name: `${pre}code_data_dictionary`,
            meta: {
                auth: ['system-code-data_dictionary'],
                title: '数据字典',
                activeMenu: '/system/code_data_dictionary',
            },
            component: () =>
                import ('@/pages/system/codeDataDictionary/index'),
        },
        {
            path: 'maintain/clear/index',
            name: `${pre}clear`,
            meta: {
                auth: ['system-clear'],
                title: '刷新缓存',
            },
            component: () =>
                import ('@/pages/system/clear/index'),
        },
        {
            path: 'maintain/system_log/index',
            name: `${pre}systemLog`,
            meta: {
                auth: ['system-maintain-system-log'],
                title: '系统日志',
            },
            component: () =>
                import ('@/pages/system/maintain/systemLog/index'),
        },
        {
            path: 'config/system_config_tab/index',
            name: `${pre}configTab`,
            meta: {
                auth: ['system-config-system_config-tab'],
                title: '配置分类',
            },
            component: () =>
                import ('@/pages/system/configTab/index'),
        },
        {
            path: 'config/system_config_tab/list/:id?',
            name: `${pre}configTabList`,
            meta: {
                auth: ['system-config-system_config_tab-list'],
                title: '配置列表',
                activeMenu: '/system/config/system_config_tab/index',
            },
            component: () =>
                import ('@/pages/system/configTab/list'),
        },
        {
            path: 'config/system_group/index',
            name: `${pre}group`,
            meta: {
                auth: ['system-config-system_config-group'],
                title: '组合数据',
            },
            component: () =>
                import ('@/pages/system/group/index'),
        },
        {
            path: 'config/system_group/list/:id?',
            name: `${pre}groupList`,
            meta: {
                auth: ['system-config-system_config-list'],
                title: '组合数据列表',
                activeMenu: '/system/config/system_group/index',
            },
            component: () =>
                import ('@/pages/system/group/list'),
        },
        {
            path: 'crontab',
            name: `${pre}crontab`,
            meta: {
                auth: ['system-crontab-index'],
                title: '定时任务',
            },
            component: () =>
                import ('@/pages/system/crontab/index'),
        },
        {
            path: 'system_menus/index',
            name: `${pre}systemMenus`,
            meta: {
                auth: ['system-system-menus'],
                title: '权限规则',
            },
            component: () =>
                import ('@/pages/system/systemMenus/index'),
        },
    ],
};